﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using MyMat;
namespace UnitTestMatrix
{
    [TestClass]
    public class TestVector
    {
        [TestMethod]
        public void Vector_Add()
        {
            MyVector test1=new MyVector();
            MyVector test2 = new MyVector();
            test1.Date = new double[] {4,5.3,6,7};
            test2.Date = new double[] { 4, 5.3, 6, 7 };
            MyVector test3 = new MyVector();
            test3=test1 + test2;
            Assert.AreEqual(test3.Date[0], 8);
            Assert.AreEqual(test3.Date[1], 10.6);
            Assert.AreEqual(test3.Date[2], 12);
            Assert.AreEqual(test3.Date[3], 14);
        }
        [TestMethod]
        public void Vector_AddEqu()
        {
            MyVector test1 = new MyVector();
            MyVector test2 = new MyVector();
            test1.Date = new double[] { 4, 5.3, 6, 7 };
            test2.Date = new double[] { 4, 5.3, 6, 7 };
            test1 +=test2;
            Assert.AreEqual(test1.Date[0], 8);
            Assert.AreEqual(test1.Date[1], 10.6);
            Assert.AreEqual(test1.Date[2], 12);
            Assert.AreEqual(test1.Date[3], 14);
        }
        [TestMethod]
        public void Vector_MUL()
        {
            MyVector test1 = new MyVector();
            MyVector test2 = new MyVector();
            test1.Date = new double[] { 4, 5, 6, 7 };
            test2 = 3 * test1;
            Assert.AreEqual(test2.Date[0], 12);
            Assert.AreEqual(test2.Date[1], 15);
            Assert.AreEqual(test2.Date[2], 18);
            Assert.AreEqual(test2.Date[3], 21);
        }

    }
}
